package com.zipking.cloud.springbootmybatis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zipking.cloud.springbootmybatis.model.TaskWrapper;
import com.zipking.cloud.springbootmybatis.persistance.entity.MsgLog;
import com.zipking.cloud.springbootmybatis.persistance.mapper.MsgLogMapper;
import com.zipking.cloud.springbootmybatis.service.ITask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@Slf4j
@Component
public class OperatorTask implements ITask<MsgLog> {
    @Autowired
    private MsgLogMapper msgLogMapper;

    @Override
    public void run(TaskWrapper<MsgLog> taskWrapper) {
        try{
            LambdaQueryWrapper<MsgLog> queryWrapper = new LambdaQueryWrapper<MsgLog>();
            queryWrapper.eq(MsgLog::getRoutingKey,"XX");
            int count = msgLogMapper.selectCount(queryWrapper);
        }catch (Exception e){
            log.error(e.getMessage(),e);
            Map<String, Object> map = new HashMap<>();
            map.put("errorMsg",e.getMessage());
            //usersMapper.insertTransLog(map);
        }
    }
}

